<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return=array();
$setting=$this->setting;
$return['setting']=$setting;
if($_RQ['op']=='get'){
	$return['ischecklogin']=model('jy_weishop/member')->checklogin('','','','',true);
	//$return['show_setmember']=cfc('core')->check_setmember(1);
	$id=intval($_RQ['id']);
	if(!$id){
		exi('没有找到该活动，请重新选择！','error','jy_worker_ewm/index/');
	}
	pdo_update('jy_worker_ewm_list',array('num +='=>1),array('uniacid'=>$_SESSION['uniacid'],'id'=>$id));
	$this->model('model')->checkgo($id);
	$item=pdo_get('jy_worker_ewm_list',array('uniacid'=>$_SESSION['uniacid'],'id'=>$id));
	if($item['merchid']){
	   model('jy_merch/member')->up_addmember($item['merchid']);
	}
	$this->model('model')->uplog($id);
	$worker=pdo_get('jy_scrm_worker',array('uniacid'=>$_SESSION['uniacid'],'id'=>$item['workerid']));
	$item['image']=tomedia($item['image']);
	$item['ewm']=tomedia($item['ewm']);
	$return['item']=$item;
	$return['url']=custom_url('jy_worker_ewm/item//id='.$item['id'],true);
	$return['worker']=$worker;
	$return['sharedata']=array(
		'title'=>$item['title'],
		'desc'=>$item['desc'],
		'link'=>custom_url('jy_worker_ewm/item//id='.$item['id'],true),
		'imgUrl'=>ATTACHMENT_URL.$item['image'],
	);
	set_html('title',$item['title']);
	exi($return);
}
